package validates

import "myapp/dal/model"

type Article struct {
	model.Article
	Time   string `json:"time"`
	TimeEn string `json:"time_en"`
}

func ProcessArticle(nd *model.Article) Article {
	time, _ := FormatTime(nd.CreatedAt.Format("2006-01-02 15:04:05"), false)
	timeEn, _ := FormatTime(nd.CreatedAt.Format("2006-01-02 15:04:05"), true)
	return Article{
		Article: *nd,
		Time:    time,
		TimeEn:  timeEn,
	}
}
